package com.moetube.video.dao;

import com.moetube.video.pojo.Barrage;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 弹幕持久层
 * @author ccr
 * @version 1.0
 */
public interface BarrageMapper extends Mapper<Barrage> {
    @Select("select * from barrage where video_id=#{videoId}")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "time",property = "time"),
            @Result(column = "barrage_time",property = "barrageTime"),
            @Result(column = "content",property = "content"),
            @Result(column = "video_id",property = "videoId"),
            @Result(column = "user_id",property = "userId"),
            @Result(column = "color",property = "color"),
            @Result(column = "size",property = "size"),
            @Result(column = "position",property = "position")
    })
    List<Barrage> findListByVideoId(String videoId);
}
